<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:outputStylesheet name="styles.css" library="css" />

<h:head>
	<link href="style.css" type="text/css" />
	<title>Awesome Forum</title>
</h:head>

<h:body><div class="main">

	<h:form rendered="#{user.renderLogin()}">
	<table>
		<tr>
			<td>nick: <h:inputText value="#{user.nick}" class="inputField" /></td>
			<td>pass: <h:inputSecret value="#{user.pass}" class="inputField" /></td>
			<td><h:commandButton value="Login" action="#{service.verify}" class="sendButton" /></td>
			<td><h:commandButton value="Create" action="#{service.createUser}" class="sendButton" /></td>
		</tr>		
	</table>
	</h:form>
	<h:form><h:commandLink value="home" action="index" class="biggerLinks" /> \</h:form>
	<h:form>
	<h:dataTable value="#{service.getCategories()}" var="cat" rowClasses="post">
		<h:column>
		<f:facet name="header">
			Category
		</f:facet>
			<h:commandLink value="#{cat.name}" action="#{service.showCategory(cat)}" />		
		</h:column>	
		<h:column rendered="#{user.canDelete()}">
			<h:commandButton class="delButton" value="X" action="#{service.deleteCategory(cat)}" />
		</h:column>
	</h:dataTable>
	</h:form>
	<h:form rendered="#{user.canUpdateCat()}">
		New category title: <h:inputText value="#{user.title}" class="inputField" />
		<h:commandButton value="Post" action="#{user.submit}" class="sendButton" />
	</h:form>
</div>
</h:body>
</html>